package net.xiangcaowuyu.mybatis.controller;

import net.xiangcaowuyu.mybatis.entity.Student;
import net.xiangcaowuyu.mybatis.service.StudentService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author laughing
 * @date 2020/10/26
 * @site https://www.xiangcaowuyu.net
 */
@RestController
public class StudentController {

    @Resource
    StudentService studentService;

    @RequestMapping("/student/insert")
    public String insertStudent() {
        Student student = new Student();
        student.setName("张三");
        studentService.insert(student);
        return "success";
    }

}
